<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<style>
    div{
        width: 200px;
        height: 60px;
        margin: 10px;
    }
   /* background:linear-gradient([方向/角度]，颜色列表)； */
   .a1{
       background:linear-gradient(red,black);
   }
   .a2{
       background:linear-gradient(red,black,pink,green);
   }
   .a3{
       background:linear-gradient(to left,red,black);
   }
   .a4{
       background:linear-gradient(to top left,red,black);
   }
   .a5{
       background:linear-gradient(30deg,red,black);
   }

   .b1,.b2,.b3{
        width: 200px;
        height: 200px;
        margin: 10px;
   }
   /* background: radial-gradient(颜色列表); */
   .b1{
       background: radial-gradient(red,black);
   }
   .b2{
       background: radial-gradient(red,black,pink,green);
   }
   .b3{
       border-radius: 50%;
       background: radial-gradient(red,black);
   }
</style>

<body>
    <!-- 线性渐变 -->
    <div class="a1"></div>
    <div class="a2"></div>
    <div class="a3"></div>
    <div class="a4"></div>
    <div class="a5"></div>

    <!-- 径向渐变 -->
    <div class="b1"></div>
    <div class="b2"></div>
    <div class="b3"></div>
</body>
</html>